<?php
namespace App\Event\UserPay;

use App\Event\Event;
use App\Repository\ShopRepository;

// 创建用户事件
class CreateEvent extends Event
{
    public $pay;
    
    public $money;
    
    public $user;
    
    public $shop;
    
    // 用户及金额
    public function __construct($pay, $user)
    {
        $this->pay = $pay;
        $this->money = $pay->money;
        $this->user = $user;
        
        if($this->user->shop)
        {
            $this->shop = ShopRepository::make($this->user->shop);
        }
    }
}